Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize only with ctrl #705

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Resize only with ctrl #705

wants to merge 5 commits into from

Conversation

studywolf
Copy link
Contributor

Just added an event handler for items that checks the key pressed, if it's ctrl then it sets 'resizable' to false, and then back to true when the key is let up. The idea is just to make it easier to move around items. I've often had it when an ensemble or whatnot is small and I can't click on it to move without zooming in, i'm only able to resize. So this addresses that!

Addresses #625, uses ctrl instead of alt because alt is a thing in chrome.

Based on #704, which should be merged first!

@studywolf
Copy link
Contributor Author

oops, apparently this also has the ng fix in there toooooo...best course of action @tbekolay ?

@tbekolay
Copy link
Member

You can either rebase this branch to master, or you can just note that this branch is based on #704 and should be merged first.

@studywolf
Copy link
Contributor Author

done! thanks!

@tcstewar
Copy link
Collaborator

Hmm... for me (on Chromium), once I touch Ctrl I can no longer resize any of the components. It's like the keyup never happens at all. Does that happen to you?

@studywolf
Copy link
Contributor Author

hmm nope it clicks back as soon as i let go, i'm using Google Chrome 49.0.2623.87 on ubuntu 14.04

}
});
$(document).bind('keyup', function(event) {
interact(self.div).resizable(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be inside an if (event.ctrlKey) check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it should!

@tcstewar
Copy link
Collaborator

hmm nope it clicks back as soon as i let go, i'm using Google Chrome 49.0.2623.87 on ubuntu 14.04

Weird... It's failing for me on Chrome 44.0.2403.107 as well... And firefox 36.0.4... (on Mint 17) those are both old versions, but still, everything else works on them.... I'll poke around on other machines...

@studywolf
Copy link
Contributor Author

hmm yeah i'm on my workstation now and getting some weird behaviour from this. i'll double check things on my laptop when i'm back home tonight...

@studywolf
Copy link
Contributor Author

looks like it should be checking the keycode on keyup instead of ctrlKey, can you try it now @tcstewar?

@tcstewar
Copy link
Collaborator

looks like it should be checking the keycode on keyup instead of ctrlKey, can you try it now @tcstewar?

That fixes it for me on Chrome and Firefox :)

One small thing: could there be a comment added to indicate that keyCode===17 is the ctrl button?

@studywolf
Copy link
Contributor Author

comment added!

@tcstewar
Copy link
Collaborator

Cool.... and one more thing -- it should probably be added to the hotkeys text. :)

@studywolf
Copy link
Contributor Author

hmmmm how would you describe this? Temporarily disable resize? Easy move? ...??

@tcstewar
Copy link
Collaborator

hmmmm how would you describe this? Temporarily disable resize? Easy move? ...??

Hmm... I think just "Disable resize..............Ctrl" should be okay....

@studywolf
Copy link
Contributor Author

k!

On Tue, Mar 22, 2016 at 3:55 PM, tcstewar [email protected] wrote:

hmmmm how would you describe this? Temporarily disable resize? Easy move?
...??

Hmm... I think just "Disable resize Ctrl" should be okay....


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#705 (comment)

@studywolf
Copy link
Contributor Author

added!

Use self-documenting code instead of comment.
Be consistent in use of key codes instead of ctrlKey flag.
@jgosmann
Copy link
Collaborator

jgosmann commented Aug 2, 2016

Added a commit to use self-documenting code instead of comments and to be consistent with the use of key codes (instead of the ctrlKey flag).
Apart from that this LGTM. 🍰

@mgserafi
Copy link

Tested and confirmed it still works in Chrome.
LGTM! (just learned what that means)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants